package com.zj.fx.model.auto;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.hutool.core.util.StrUtil;

/**
 * 月度数据导入原始数据结果统计台账 AutoOriimportRecordExample
 * @author SQL_自动生成
 * @date 2024-02-26 10:23:36
 */
public class AutoOriimportRecordExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public AutoOriimportRecordExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        
            public Criteria andIdIsNull() {
                addCriterion("id is null");
                return (Criteria) this;
            }

            public Criteria andIdIsNotNull() {
                addCriterion("id is not null");
                return (Criteria) this;
            }

            public Criteria andIdEqualTo(String value) {
                addCriterion("id =", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotEqualTo(String value) {
                addCriterion("id <>", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThan(String value) {
                addCriterion("id >", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThanOrEqualTo(String value) {
                addCriterion("id >=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThan(String value) {
                addCriterion("id <", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThanOrEqualTo(String value) {
                addCriterion("id <=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLike(String value) {
                addCriterion("id like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotLike(String value) {
                addCriterion("id not like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdIn(List<String> values) {
                addCriterion("id in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotIn(List<String> values) {
                addCriterion("id not in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdBetween(String value1, String value2) {
                addCriterion("id between", value1, value2, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotBetween(String value1, String value2) {
                addCriterion("id not between", value1, value2, "id");
                return (Criteria) this;
            }

        
            public Criteria andImportTimeIsNull() {
                addCriterion("import_time is null");
                return (Criteria) this;
            }

            public Criteria andImportTimeIsNotNull() {
                addCriterion("import_time is not null");
                return (Criteria) this;
            }

            public Criteria andImportTimeEqualTo(Date value) {
                addCriterion("import_time =", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeNotEqualTo(Date value) {
                addCriterion("import_time <>", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeGreaterThan(Date value) {
                addCriterion("import_time >", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeGreaterThanOrEqualTo(Date value) {
                addCriterion("import_time >=", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeLessThan(Date value) {
                addCriterion("import_time <", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeLessThanOrEqualTo(Date value) {
                addCriterion("import_time <=", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeLike(Date value) {
                addCriterion("import_time like", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeNotLike(Date value) {
                addCriterion("import_time not like", value, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeIn(List<Date> values) {
                addCriterion("import_time in", values, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeNotIn(List<Date> values) {
                addCriterion("import_time not in", values, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeBetween(Date value1, Date value2) {
                addCriterion("import_time between", value1, value2, "importTime");
                return (Criteria) this;
            }

            public Criteria andImportTimeNotBetween(Date value1, Date value2) {
                addCriterion("import_time not between", value1, value2, "importTime");
                return (Criteria) this;
            }

        
            public Criteria andTotalCountIsNull() {
                addCriterion("total_count is null");
                return (Criteria) this;
            }

            public Criteria andTotalCountIsNotNull() {
                addCriterion("total_count is not null");
                return (Criteria) this;
            }

            public Criteria andTotalCountEqualTo(String value) {
                addCriterion("total_count =", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountNotEqualTo(String value) {
                addCriterion("total_count <>", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountGreaterThan(String value) {
                addCriterion("total_count >", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountGreaterThanOrEqualTo(String value) {
                addCriterion("total_count >=", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountLessThan(String value) {
                addCriterion("total_count <", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountLessThanOrEqualTo(String value) {
                addCriterion("total_count <=", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountLike(String value) {
                addCriterion("total_count like", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountNotLike(String value) {
                addCriterion("total_count not like", value, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountIn(List<String> values) {
                addCriterion("total_count in", values, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountNotIn(List<String> values) {
                addCriterion("total_count not in", values, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountBetween(String value1, String value2) {
                addCriterion("total_count between", value1, value2, "totalCount");
                return (Criteria) this;
            }

            public Criteria andTotalCountNotBetween(String value1, String value2) {
                addCriterion("total_count not between", value1, value2, "totalCount");
                return (Criteria) this;
            }

        
            public Criteria andSuccessCountIsNull() {
                addCriterion("success_count is null");
                return (Criteria) this;
            }

            public Criteria andSuccessCountIsNotNull() {
                addCriterion("success_count is not null");
                return (Criteria) this;
            }

            public Criteria andSuccessCountEqualTo(String value) {
                addCriterion("success_count =", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountNotEqualTo(String value) {
                addCriterion("success_count <>", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountGreaterThan(String value) {
                addCriterion("success_count >", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountGreaterThanOrEqualTo(String value) {
                addCriterion("success_count >=", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountLessThan(String value) {
                addCriterion("success_count <", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountLessThanOrEqualTo(String value) {
                addCriterion("success_count <=", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountLike(String value) {
                addCriterion("success_count like", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountNotLike(String value) {
                addCriterion("success_count not like", value, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountIn(List<String> values) {
                addCriterion("success_count in", values, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountNotIn(List<String> values) {
                addCriterion("success_count not in", values, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountBetween(String value1, String value2) {
                addCriterion("success_count between", value1, value2, "successCount");
                return (Criteria) this;
            }

            public Criteria andSuccessCountNotBetween(String value1, String value2) {
                addCriterion("success_count not between", value1, value2, "successCount");
                return (Criteria) this;
            }

        
            public Criteria andFailCountIsNull() {
                addCriterion("fail_count is null");
                return (Criteria) this;
            }

            public Criteria andFailCountIsNotNull() {
                addCriterion("fail_count is not null");
                return (Criteria) this;
            }

            public Criteria andFailCountEqualTo(String value) {
                addCriterion("fail_count =", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountNotEqualTo(String value) {
                addCriterion("fail_count <>", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountGreaterThan(String value) {
                addCriterion("fail_count >", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountGreaterThanOrEqualTo(String value) {
                addCriterion("fail_count >=", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountLessThan(String value) {
                addCriterion("fail_count <", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountLessThanOrEqualTo(String value) {
                addCriterion("fail_count <=", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountLike(String value) {
                addCriterion("fail_count like", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountNotLike(String value) {
                addCriterion("fail_count not like", value, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountIn(List<String> values) {
                addCriterion("fail_count in", values, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountNotIn(List<String> values) {
                addCriterion("fail_count not in", values, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountBetween(String value1, String value2) {
                addCriterion("fail_count between", value1, value2, "failCount");
                return (Criteria) this;
            }

            public Criteria andFailCountNotBetween(String value1, String value2) {
                addCriterion("fail_count not between", value1, value2, "failCount");
                return (Criteria) this;
            }

        
        public Criteria andLikeQuery(AutoOriimportRecord record) {
            List<String> list = new ArrayList<String>();
            List<String> list2 = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list.add("ifnull(id,'')");
                }
                            if (record.getImportTimeStr() != null && StrUtil.isNotEmpty(record.getImportTimeStr().toString())) {
                    list.add("ifnull(DATE_FORMAT(import_time, '%Y-%m-%d'),'')");
                }
                            if (record.getTotalCount() != null && StrUtil.isNotEmpty(record.getTotalCount().toString())) {
                    list.add("ifnull(total_count,'')");
                }
                            if (record.getSuccessCount() != null && StrUtil.isNotEmpty(record.getSuccessCount().toString())) {
                    list.add("ifnull(success_count,'')");
                }
                            if (record.getFailCount() != null && StrUtil.isNotEmpty(record.getFailCount().toString())) {
                    list.add("ifnull(fail_count,'')");
                }
                                        if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list2.add("'%" + record.getId() + "%'");
                }
                            if (record.getImportTimeStr() != null && StrUtil.isNotEmpty(record.getImportTimeStr().toString())) {
                    list2.add("'%" + record.getImportTimeStr() + "%'");
                }
                            if (record.getTotalCount() != null && StrUtil.isNotEmpty(record.getTotalCount().toString())) {
                    list2.add("'%" + record.getTotalCount() + "%'");
                }
                            if (record.getSuccessCount() != null && StrUtil.isNotEmpty(record.getSuccessCount().toString())) {
                    list2.add("'%" + record.getSuccessCount() + "%'");
                }
                            if (record.getFailCount() != null && StrUtil.isNotEmpty(record.getFailCount().toString())) {
                    list2.add("'%" + record.getFailCount() + "%'");
                }
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append(" like CONCAT(");
            buffer.append(StrUtil.join(",", list2));
            buffer.append(")");
            if (!" CONCAT() like CONCAT()".equals(buffer.toString())) {
                addCriterion(buffer.toString());
            }
            return (Criteria) this;
        }

        public Criteria andLikeQuery2(String searchText) {
            List<String> list = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            list.add("ifnull(id,'')");
                            list.add("ifnull(import_time,'')");
                            list.add("ifnull(total_count,'')");
                            list.add("ifnull(success_count,'')");
                            list.add("ifnull(fail_count,'')");
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append("like '%");
            buffer.append(searchText);
            buffer.append("%'");
            addCriterion(buffer.toString());
            return (Criteria) this;
        }

    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}